package es.gesfutbol.domini.implementacio;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import es.gesfutbol.domini.IPronostic;

@Entity
@Table(name="pronostic")
public class Pronostic implements IPronostic {

	/**
	 * 
	 */
	private static final long serialVersionUID = -6287792093354340133L;

	private Long idPronostic;
	
	private CombinacioGeneral combinacioGeneral;
	
	private CombinacioPropia combinacioPropia;
	
	private Penyista penyista;
	
	private PartitDeQuiniela partitDeQuiniela;
	
	private boolean un;
	
	private boolean ix;
	
	private boolean dos;

	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	@Column(name="idPronostic", nullable=false, precision = 10, scale=0)
	public Long getIdPronostic() {
		return idPronostic;
	}

	public void setIdPronostic(Long idPronostic) {
		this.idPronostic = idPronostic;
	}

	@ManyToOne(fetch=FetchType.LAZY)
	@JoinColumn(name="idCombGeneral" , nullable=true)
	public CombinacioGeneral getCombinacioGeneral() {
		return combinacioGeneral;
	}

	public void setCombinacioGeneral(CombinacioGeneral combinacioGeneral) {
		this.combinacioGeneral = combinacioGeneral;
	}

	@ManyToOne(fetch=FetchType.LAZY)
	@JoinColumn(name="idCombPropia" , nullable=true)
	public CombinacioPropia getCombinacioPropia() {
		return combinacioPropia;
	}

	public void setCombinacioPropia(CombinacioPropia combinacioPropia) {
		this.combinacioPropia = combinacioPropia;
	}

	@ManyToOne(fetch=FetchType.LAZY)
	@JoinColumn(name="idPenyista" , nullable=false)
	public Penyista getPenyista() {
		return penyista;
	}

	public void setPenyista(Penyista penyista) {
		this.penyista = penyista;
	}

	@ManyToOne(fetch=FetchType.LAZY)
	@JoinColumn(name="idPartitDeQuiniela" , nullable=false)
	public PartitDeQuiniela getPartitDeQuiniela() {
		return partitDeQuiniela;
	}

	public void setPartitDeQuiniela(PartitDeQuiniela partitDeQuiniela) {
		this.partitDeQuiniela = partitDeQuiniela;
	}

	@Column(name="un",columnDefinition = "tinyint", nullable = false)
	public boolean isUn() {
		return un;
	}

	public void setUn(boolean un) {
		this.un = un;
	}

	@Column(name="ix",columnDefinition = "tinyint", nullable = false)
	public boolean isIx() {
		return ix;
	}

	public void setIx(boolean ix) {
		this.ix = ix;
	}

	@Column(name="dos",columnDefinition = "tinyint", nullable = false)
	public boolean isDos() {
		return dos;
	}

	public void setDos(boolean dos) {
		this.dos = dos;
	}
}
